<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
		<link rel="stylesheet" type="text/css" href="../style.css" media="screen" />
		<link rel="stylesheet" type="text/css" href="../small.css" media="handheld, screen and (max-width:39em), only screen and (max-device-width:30em)" />
		<link rel="stylesheet" type="text/css" href="../print.css" media="print" />
		<link rel="shortcut icon" type="image/x-icon" href="../images/favicon.ico" />
		<title><nome del piatto> - Mensa NordESU Piovego</title>
		<script type="text/javascript">
		<!--
			function validateForm(){
				//alert("here...");
				var txtEmail = document.getElementById("email");
				var txtCommento = document.getElementById("commento");
				var flagValidate = false;
				if(txtEmail && txtCommento){
					//validazione txtEmail e txtCommento
					if(txtEmail.value.indexOf("@") > 1 && txtEmail.value.lastIndexOf(".")>txtEmail.value.indexOf("@") && txtCommento.value != "")
						flagValidate = true;				
				}
				if(flagValidate)
				{
					//form validato
					alert("Invio form...");
				}
				else
				{
					if(!(txtEmail.value.indexOf("@") > 1 && txtEmail.value.lastIndexOf(".")>txtEmail.value.indexOf("@")))
					{
						//il campo email non è corretto
						if(!(document.getElementById("lblEmailWarning")))
						{
							var emailAlertLabel = document.createElement("LABEL");
							emailAlertLabel.appendChild(document.createTextNode("Inserire un indirizzo email valido!"));
							emailAlertLabel.className = "";
							emailAlertLabel.id = "lblEmailWarning";
							emailAlertLabel.color ="red";						
							txtEmail.parentNode.appendChild(emailAlertLabel);
						}
						txtEmail.style.borderColor = 'red';
						txtEmail.focus();
						txtEmail.select();					
					}
					else{
						//set default
						txtEmail.style.borderColor= 'black';
						if(document.getElementById("lblEmailWarning"))
							document.getElementById("lblEmailWarning").innerHTML = "";					
					}
					if(!(txtCommento.value != ""))
					{
						if(!(document.getElementById("lblCommentoWarning")))
						{
							var commentoAlertLabel = document.createElement("LABEL");
							commentoAlertLabel.appendChild(document.createTextNode("Inserire un commento valido!"));
							commentoAlertLabel.className = "";
							commentoAlertLabel.color ="red";	
							commentoAlertLabel.id = "lblCommentoWarning";
							txtCommento.parentNode.appendChild(commentoAlertLabel);	
						}
						txtCommento.style.borderColor = 'red';
						txtCommento.focus();
						txtCommento.select();
					}
					else{
						//set default
						txtCommento.style.borderColor='black';
						if(document.getElementById("lblCommentoWarning"))
							document.getElementById("lblCommentoWarning").innerHTML = "";
					}
				}
			}
		
		
		//-->
		</script>
		<noscript>
			<!-- Per browser che non supportano script-->
		</noscript>
	</head>
	<body>
		<div id="header">
			<span id="lang">
				<span id="lang_switch_selected">ITA</span>
				<a id="lang_switch" href="">ENG</a>
			</span>
			<h1>Ristorante NordESU Piovego</h1>
		</div>
		<div id="path">
			Ti trovi in: <a href="../index.html"><span xml:lang="eng">Home</span></a> > <a href="../piatti.html"><span xml:lang="eng">Piatti</span></a> > <span id="clb">Nome del piatto</span>
		</div>
		<div id="nav">
			<ul>
				<li>
					<span xml:lang="eng"><a href="../index.html">Home</a></span>
				</li>
				<li>
					<a href="../news.html"><span xml:lang="en">News</span></a>
				</li>
				<li>
					<a href="../where.html">Dove Siamo</a>
				</li>
				<li>
					<a href="../menu.html">Piatti</a>
				</li>
				<li>
					<a href="../prices.html">Prezzi</a>
				</li>
				<li>
					<a href="../info.html">Info e Contatti</a>
				</li>
			</ul>
		</div>
		<div id="section">
			<h1>Nome del piatto</h1>
			<div >			
				<div id="recent_news">
					TESTO RECUPERATO DA XML TRAMITE MAGIA HERE
					Sei invitato a votarli e a lasciare un <a href="#form">commento</a>!
				</div>
				<div id="content"><img src="../images/gnocchi.png" alt="Gnocchi al sugo con abbondante ragù" /></div>
					
			</div>			
			<h2>
				Commenti:
			</h2>
			
			<!-- Commenti recenti -->
			<div class="commenti_recenti" id="menu_section" >
				<dl>
					<dt>
						Nome utente1 RECUPERATO DA XML
					</dt>
					<dd>
						TESTO RECUPERATO DA XML
						
					</dd>
				</dl>
		</div>
		
		<h2>
				Commenta!
			</h2>
		<!-- form inserimento commenti -->
		<div id="form_container" class="dish_form">
			<a name="form">
				<!-- <form class="commenti_submit" method="post">action="something.cgi">-->
				<fieldset>
					<legend>
						I tuoi dati
					</legend>
					<dl>
						<dd>
							<p class="form_description">
								<label id="lblEmail" for="email">La tua email:</label>&nbsp;
							</p>
							<p class="form_item">
								<input type="text" id="email" alt="Indirizzo email"/>
							</p>
						</dd>				
						<dd>
							<p class="form_description">
								<label id="lblCommento" for="commento">Commento</label>&nbsp;
							</p>
							<p class="form_item">
								<input type="text" id="commento" alt="Commento..."/>
							</p>
						</dd>				
					</dl>
				</fieldset>
				<!-- <button type="submit" onclick="validateForm();">Invia!</button> -->
				<input type="button" id="btnSubmit" onclick="validateForm()" value="Invia!" class="form_action"/>
			
			<!--</form>-->
			</a>
		</div>
		
		</div>
		<div id="footer">
			<span id="social_container">
				<a href="http://www.facebook.com"><img src="../images/icon_fb.png" alt="Facebook" /></a>
				<a href="http://www.foursquare.com"><img src="../images/icon_foursquare.png" alt="Foursquare" /></a>
				<a href="http://www.instagram.com"><img src="../images/icon_instagram.png" alt="Instagram" /></a>
			</span>
			<span id="credits">Mensaddicted</span>
			<span id="w3c_container">
				<a href="http://validator.w3.org/check?uri=referer">
					<img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict"/></a>
				<a href="http://jigsaw.w3.org/css-validator/check/referer">
					<img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="CSS Valido!" />
    			</a>
			</span>
		</div>
	</body>
</html>